﻿// 首页JS
(function ($) {

    $.Home = {};

    $.Home.tabs = {
        addTab: function (title, url) {
            if ($("#tab-center").tabs("exists", title)) {
                $("#tab-center").tabs("select", title);
            }
            else {
                $("#tab-center").tabs("add", {
                    title: title,
                    content: " <iframe src=\"" + url + "\" style=\"width: 100%; height: 100%\" frameborder=\"0\" scrolling=\"auto\" ></iframe> ",
                    iconCls: "icon-page",
                    closable: true,
                    bodyCls: "tabOverflow"
                });
            }
        }
    };

    $.extend($.Home, {
        pageLoad: function () {

            // 左侧导航点击事件
            $(".accordion-row").click(function () {
                var title = $(this).attr("data-title");
                var url = $(this).attr("data-url");
                $.Home.tabs.addTab(title, url);
            });
        }
    });

})(jQuery);

$(function () {
    $.Home.pageLoad();
});